<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>字符串的排列组合</title>
</head>

<body>

</body>

</html>
<script>
    function pailie(str) {
        let arr = []
        let string = ''

        for (let i = 0; i < str.length; i++) {
            string += str[i]
            for (let j = 0; j < str[i].length; j++) {
                string += str.slice(0, i) + str.slice(i + 1, str.length)
                console.log(string);

                arr.push(string)
                string = ''

            }


        }
        return arr
    }
    let str = 'abc'
    console.log(pailie(str));
</script>